package com.example.rental_system.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.rental_system.mapper.AdminMapper;
import com.example.rental_system.pojo.Admin;
import com.example.rental_system.pojo.User;
import com.example.rental_system.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImp extends ServiceImpl<AdminMapper, Admin> implements AdminService {
    @Autowired
    private AdminMapper adminMapper;
    @Override
    public boolean queryByName(String adminName) {
        QueryWrapper<Admin> qw = new QueryWrapper<>();
        qw.eq("admin_name",adminName);
        boolean exists = adminMapper.exists(qw);
        return exists;
    }
}
